//
//  LXDSelectSingerTableViewCell.m
//  BLDMusics
//
//  Created by lxd on 16/3/20.
//  Copyright © 2016年 李晓丹. All rights reserved.
//

#import "LXDSelectSingerTableViewCell.h"

@interface  LXDSelectSingerTableViewCell ()

/**歌手图片网址*/
@property (nonatomic, retain) UIImageView *singerImage;

/**歌手姓名*/
@property (nonatomic, retain) UILabel *nameLabel;


@end

@implementation LXDSelectSingerTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createControl];
    }
    return self;
}

- (void)createControl {
    self.singerImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_singerImage];
    
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_nameLabel];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    self.backgroundColor = [UIColor clearColor];
    
    _singerImage.frame = CGRectMake(10, 10, 60, 60);
    _singerImage.layer.cornerRadius = 30;
    _singerImage.layer.masksToBounds = YES;
    _singerImage.backgroundColor = [UIColor yellowColor];
    
    _nameLabel.frame = CGRectMake(90, 30, self.bounds.size.width - 100, 20);
}

- (void)setModel:(LXDSingerModel *)model {
    _model = model;
        [_singerImage sd_setImageWithURL:[NSURL URLWithString:self.model.pic_url] placeholderImage:PLACEHOLDER];
    _nameLabel.text = self.model.singer_name;
    
}

@end
